{% assign data = section.settings %}
{% assign blockId = block_id | default : section.block_id %}
{%- capture fill_container -%}
  {%- if data.is_fill -%}
    full_container_wrapper
  {%- else -%}
    container_wrapper
  {%- endif -%}
{%- endcapture -%}
<div class="block_slogan relative" id="block_slogan-{{blockId}}" style="--bg: {{data.bg_color}};--text-color: {{data.text_color}};--dividing-color: {{data.dividing_color}};">
  <div class="mask hidden absolute" style="background: linear-gradient(90deg, rgba(248, 248, 248, 0), rgb(248, 248, 248));"></div>
  <div class="{{fill_container}}">
    <div class="content md:text-left text-center">
      <ul class="list flex md:gap-10 gap-5 justify-center flex-wrap">
        {% for block in section.blocks %}
          <li class="list_item md:flex-1 flex md:gap-10 items-center justify-center md:flex-row flex-col ">
            <div class="left">
              {% if block.image.src  %}
                {% include 'lazy_img', src: block.image.src, alt: block.image.alt %}
              {% else %}
                {% include 'icon_slogan' slogan: block.icon %}
              {% endif %}
            </div>

            <div class="right">
              {% if block.title != '' %}
                <div class="item-title">{{ block.title }}</div>
              {% endif %}
              {% if block.content != '' %}
                <div class="item-des mt-4">
                  {{ block.content }}
                </div>
              {% endif %}
            </div>
          </li>
        {% endfor %}
      </ul>
    </div>
  </div>
</div>

<script>
  (function() {
    $(`#block_slogan-{{blockId}}`).parent().css('margin-bottom', `{{section.settings.margin_bottom}}px`);
  })()
</script>

{% schema %}
  {
    "name": {
      "zh_CN": "slogan",
      "en_US": "Slogan"
    },
    "tag": "",
    "class": "block_slogan",
    "max_blocks": "4",
    "is_global": false,
    "settings": [
      {
        "type": "card_header",
        "id": "",
        "label": {
          "zh_CN": "slogan",
          "en_US": "Slogan"
        }
      },
      {
        "type": "card_switch",
        "label": {
          "zh_CN": "宽度铺满",
          "en_US": "Spread the width"
        },
        "id": "is_fill",
        "default": "false"
      },
      {
        "type": "card_input_number",
        "max": 200,
        "min": 0,
        "id": "margin_bottom",
        "label": {
          "zh_CN": "下边距",
          "en_US": "Bottom margin"
        },
        "default": 80
      },
      {
        "type": "card_color",
        "id": "bg_color",
        "label": {
          "zh_CN": "背景颜色",
          "en_US": "Background color"
        },
        "default": "#fdf9ee"
      }, {
        "type": "card_color",
        "id": "text_color",
        "label": {
          "zh_CN": "文本颜色",
          "en_US": "Text color"
        },
        "default": "#000"
      }, {
        "type": "card_color",
        "id": "dividing_color",
        "label": {
          "zh_CN": "分割线颜色"
        },
        "default": "#dcad2b"
      }
    ],
    "blocks": [
      {
        "name": {
          "zh_CN": "slogan",
          "en_US": "Slogan"
        },
        "type": "slogan-item",
        "settings": [
          {
            "type": "card_select",
            "label": {
              "zh_CN": "选择图片",
              "en_US": "Select image"
            },
            "default": "oemsaas-wuliu",
            "id": "icon",
            "option": [
              {
                "label": {
                  "zh_CN": "物流",
                  "en_US": "Logistics"
                },
                "value": "oemsaas-wuliu",
                "icon": "shopyyicon-wuliu"
              },
              {
                "label": {
                  "zh_CN": "货币",
                  "en_US": "Money"
                },
                "value": "oemsaas-huobi",
                "icon": "shopyyicon-huobi"
              },
              {
                "label": {
                  "zh_CN": "认证",
                  "en_US": "Authentication"
                },
                "value": "oemsaas-renzheng",
                "icon": "shopyyicon-renzheng"
              },
              {
                "label": {
                  "zh_CN": "全球交付",
                  "en_US": "Global delivery"
                },
                "value": "oemsaas-quanqiujiaofu",
                "icon": "shopyyicon-quanqiujiaofu"
              }, {
                "label": {
                  "zh_CN": "买家保护",
                  "en_US": "Buyer protection"
                },
                "value": "oemsaas-maijiabaohu",
                "icon": "shopyyicon-maijiabaohu"
              }, {
                "label": {
                  "zh_CN": "手机",
                  "en_US": "Cell phone"
                },
                "value": "oemsaas-iphone",
                "icon": "shopyyicon-shouji"
              }, {
                "label": {
                  "zh_CN": "聊天",
                  "en_US": "Chat"
                },
                "value": "oemsaas-liaotian",
                "icon": "shopyyicon-liaotian"
              }, {
                "label": {
                  "zh_CN": "信用卡",
                  "en_US": "Credit card"
                },
                "value": "oemsaas-xinyongka",
                "icon": "shopyyicon-xinyongka"
              }, {
                "label": {
                  "zh_CN": "邮箱",
                  "en_US": "Mailbox"
                },
                "value": "oemsaas-youxiang",
                "icon": "shopyyicon-youxiang"
              }, {
                "label": {
                  "zh_CN": "定位",
                  "en_US": "Positioning"
                },
                "value": "oemsaas-dingwei",
                "icon": "shopyyicon-dingwei"
              }, {
                "label": {
                  "zh_CN": "问题",
                  "en_US": "Problem"
                },
                "value": "oemsaas-wenti",
                "icon": "shopyyicon-wenti"
              }, {
                "label": {
                  "zh_CN": "笑脸",
                  "en_US": "Smiley face"
                },
                "value": "oemsaas-xiaolian",
                "icon": "shopyyicon-xiaolian"
              }, {
                "label": {
                  "zh_CN": "店铺/房子",
                  "en_US": "Shop/house"
                },
                "value": "oemsaas-dianpufangzi",
                "icon": "shopyyicon-a-dianpufangzi"
              }, {
                "label": {
                  "zh_CN": "礼物",
                  "en_US": "The gift,"
                },
                "value": "oemsaas-liwu",
                "icon": "shopyyicon-liwu"
              }, {
                "label": {
                  "zh_CN": "爱心",
                  "en_US": "Love"
                },
                "value": "oemsaas-aixin",
                "icon": "shopyyicon-aixin"
              }, {
                "label": {
                  "zh_CN": "折扣",
                  "en_US": "Discount"
                },
                "value": "oemsaas-zhekou",
                "icon": "shopyyicon-zhekou"
              }, {
                "label": {
                  "zh_CN": "安全锁",
                  "en_US": "Safety lock"
                },
                "value": "oemsaas-anquansuo",
                "icon": "shopyyicon-anquansuo"
              }, {
                "label": {
                  "zh_CN": "转换",
                  "en_US": "Transform"
                },
                "value": "oemsaas-zhuanhuan",
                "icon": "shopyyicon-zhuanhuan"
              }, {
                "label": {
                  "zh_CN": "购物车",
                  "en_US": "Shopping cart"
                },
                "value": "oemsaas-gouwuche",
                "icon": "shopyyicon-gouwuche"
              }, {
                "label": {
                  "zh_CN": "24h",
                  "en_US": "24h"
                },
                "value": "oemsaas-a-24h",
                "icon": "shopyyicon-a-24h"
              }, {
                "label": {
                  "zh_CN": "商品",
                  "en_US": "Product"
                },
                "value": "oemsaas-shangpin",
                "icon": "shopyyicon-shangpin"
              }, {
                "label": {
                  "zh_CN": "优惠券",
                  "en_US": "Coupons"
                },
                "value": "oemsaas-youhuiquan",
                "icon": "shopyyicon-youhuiquan"
              }, {
                "label": {
                  "zh_CN": "客户群",
                  "en_US": "Customer base"
                },
                "value": "oemsaas-kehuqun",
                "icon": "shopyyicon-kehuqun"
              }, {
                "label": {
                  "zh_CN": "编辑",
                  "en_US": "Edit"
                },
                "value": "oemsaas-bainji",
                "icon": "shopyyicon-bianji"
              }, {
                "label": {
                  "zh_CN": "会员",
                  "en_US": "Member"
                },
                "value": "oemsaas-huiyuan",
                "icon": "shopyyicon-huiyuan"
              }, {
                "label": {
                  "zh_CN": "航运",
                  "en_US": "Shipping"
                },
                "value": "oemsaas-hangyun",
                "icon": "shopyyicon-hangyun"
              }, {
                "label": {
                  "zh_CN": "建筑",
                  "en_US": "Architecture"
                },
                "value": "oemsaas-jianzhu",
                "icon": "shopyyicon-jianzhu"
              }, {
                "label": {
                  "zh_CN": "赞美",
                  "en_US": "Praise"
                },
                "value": "oemsaas-zanmei",
                "icon": "shopyyicon-zanmei"
              }, {
                "label": {
                  "zh_CN": "视频",
                  "en_US": "Video"
                },
                "value": "oemsaas-shipin",
                "icon": "shopyyicon-shipin"
              }, {
                "label": {
                  "zh_CN": "个性定制",
                  "en_US": "Customization"
                },
                "value": "oemsaas-gexingdingzhi",
                "icon": "shopyyicon-gexingdingzhi"
              }, {
                "label": {
                  "zh_CN": "增长",
                  "en_US": "Growth"
                },
                "value": "oemsaas-zengzhang",
                "icon": "shopyyicon-zengzhang"
              }, {
                "label": {
                  "zh_CN": "资料",
                  "en_US": "Data"
                },
                "value": "oemsaas-ziliao",
                "icon": "shopyyicon-ziliao"
              }, {
                "label": {
                  "zh_CN": "学生",
                  "en_US": "Student"
                },
                "value": "oemsaas-xuesheng",
                "icon": "shopyyicon-xuesheng"
              }, {
                "label": {
                  "zh_CN": "办公",
                  "en_US": "Office"
                },
                "value": "oemsaas-bangong",
                "icon": "shopyyicon-bangong"
              }, {
                "label": {
                  "zh_CN": "模块",
                  "en_US": "Module"
                },
                "value": "oemsaas-mokuai",
                "icon": "shopyyicon-mokuai"
              }, {
                "label": {
                  "zh_CN": "文件包",
                  "en_US": "File package"
                },
                "value": "oemsaas-wenjianbao",
                "icon": "shopyyicon-wenjianbao"
              }, {
                "label": {
                  "zh_CN": "文件",
                  "en_US": "File"
                },
                "value": "oemsaas-wenjian",
                "icon": "shopyyicon-wenjian"
              }, {
                "label": {
                  "zh_CN": "条约",
                  "en_US": "The Treaty"
                },
                "value": "oemsaas-tiaoyue",
                "icon": "shopyyicon-tiaoyue"
              }, {
                "label": {
                  "zh_CN": "商务",
                  "en_US": "Business"
                },
                "value": "oemsaas-shangwu",
                "icon": "shopyyicon-shangwu"
              }, {
                "label": {
                  "zh_CN": "分享",
                  "en_US": "Share"
                },
                "value": "oemsaas-a-fenxiangfabu",
                "icon": "shopyyicon-a-fenxiangfabu"
              }
            ]
          }, {
            "type": "card_image",
            "label": {
              "zh_CN": "选择图片",
              "en_US": "Select image"
            },
            "info": {
              "zh_CN": "尺寸建议48*48px",
              "en_US": "Size suggested 48*48px"
            },
            "id": "image",
            "default": {
              "src": "",
              "alt": ""
            }
          }, {
            "type": "card_input",
            "label": {
              "zh_CN": "标题",
              "en_US": "Title"
            },
            "id": "title",
            "default": "Worldwide Delivery"
          }, {
            "type": "card_text_editor",
            "label": {
              "zh_CN": "内容",
              "en_US": "Content"
            },
            "id": "content",
            "default": "Fast Shipping to over 200+ countries, Package Location Tracking Online."
          }
        ]
      }
    ],
    "default": {
      "settings": {
        "bg_color": "#fdf9ee",
        "text_color": "#000",
        "dividing_color": "#dcad2b",
        "is_fill": true,
        "margin_bottom": 80
      },
      "blocks": [
        {
          "icon": "oemsaas-wuliu",
          "image": {
            "src": "",
            "alt": ""
          },
          "title": "FREE SHIPPING",
          "content": "Capped at $50 per order.",
          "block_type": "slogan-item"
        }, {
          "icon": "oemsaas-xinyongka",
          "image": {
            "src": "",
            "alt": ""
          },
          "title": "CHAT WITH US",
          "content": "We offer 24-hour chat support.",
          "block_type": "slogan-item"
        }, {
          "icon": "oemsaas-renzheng",
          "image": {
            "src": "",
            "alt": ""
          },
          "title": "SECURETY PAYMENTS",
          "content": "Up to 12 months installments.",
          "block_type": "slogan-item"
        }
      ]
    },
    "icon": "icon-lunbotu"
  }
{% endschema %}